<div class="p-head">
    <b class="c3">论坛</b>
    <div class="r">
        <a href="/bbs/index/3/" class="ajax" title="意见反馈">意见反馈</a>
    </div>
    <div id="desc">
        记录每天生活的点点滴滴。。。
    </div>
</div>
<div class="tabs_t tabs_n">
    <ul class="ajax">
        <?php foreach (get_category_list('bbs', 0, array(array('id' => 0, 'name' => '全部')), 0) as $k => $v) { ?>
            <li class="<?= $category_id == $v['id'] ? "current" : '' ?>"><a href="/bbs/index/<?= $v['id'] ?>/" sid="<?= $v['id'] ?>"><?= $v['name'] ?></a></li>
        <?php } ?>
    </ul>
    <span class="r clear">
        <a href="/bbs/add/<?= $category_id ?>/" title="发表新贴" class="btn btn_s dialog" close="true" callback="bbs_callback"><span><b class="icon icon-edit"></b><em>发表新贴</em></span></a>
    </span>
</div>
<div id="bbs">
    <table class="data list" cellpadding="0" cellspacing="1" width="100%" style="margin-bottom:0;">
        <?php foreach ($list as $k => $v) { ?>
            <tr>
                <td width="30"><div class="<?= TIME - $v['replytime'] <= 86400 ? "newthread" : "nothread" ?>"></div></td>
                <td class="title">
                    <a href="/bbs/show/<?= $v['id'] ?>/" class="ajax"><?= $v['title'] ?></a>
                    <?php if (in_array('top', $v['flag'])) { ?><i class="top" title="置顶">置顶</i><?php } ?>
                    <?php if (in_array('best', $v['flag'])) { ?><i class="best" title="精华">精</i><?php } ?>
                    <?php if (in_array('commend', $v['flag'])) { ?><i class="commend" title="推荐">荐</i><?php } ?>
                    <?php if (in_array('hot', $v['flag'])) { ?><i class="hot" title="热闹">热</i><?php } ?>
                    <br />
                    <div class="author"><a href="/"><?= $v['nickname'] ?></a> 
                        <?php if ($category_id == 0) { ?>发表在 <a href="/bbs/index/<?= $v['category_id'] ?>/" class="ajax"><?= isset($v['category']['name']) ? $v['category']['name'] : '未知' ?></a><?php } else { ?>发表于<?php } ?>
                        <?= date("m-d H:i", $v['createtime']) ?>
                    </div>
                </td>
                <td width="50" class="count"><?= $v['replies'] ?>/<?= $v['views'] ?></td>
                <td width="90" class="info">
                    <?php if ($v['lastreply']) { ?>
                        <a href="/"><?= $v['lastreply']['nickname'] ?></a> <br />回应于<?= format_time($v['replytime']) ?>
                    <?php } else { ?>
                        <a href="/"><?= $v['nickname'] ?></a> <br />回应于<?= format_time($v['createtime']) ?>
                    <?php } ?>
                </td>
            </tr>
        <?php } ?>
        <tr>
            <td colspan="4" style="padding:0;">
                <div class="pager graybg ajax">
                    <?= $pagelist ?> 
                </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    KS.common.load('bbs.index');
</script>